// miniprogram/pages/index/index.js
var QQMapWX = require('../../utils/qqmap-wx-jssdk.js');
var qqmapsdk;
const {
  checkLogin,
  message
} = require('../../utils/util')
const {
  mainViewPic,
  getScore,
  articleList,
  courseList,
  memberCardPay,
  discountPay,
  schoolRecommend,
  reviewScan
} = require('../../api/api')
const {
  debounce,
  canParseToJson
} = require('../../utils/util')
var timer = null
var DateArray = ['2023,5,7', '2024,5,7', '2025,5,7']
var direction = null

function gaokaoTime() {
  // setInterval(function () {
  // 现在的日期
  var d = new Date();
  var year = d.getFullYear()
  var month = d.getMonth()
  var day = d.getDate()
  var dd = null;
  dd = new Date(year, 5, 7)
  if (dd < d) {
    dd = new Date(year + 1, 5, 7)
  }
  // if (month < 5) {
  //   dd = new Date(year, 5, 7)
  // } else {
  //   if (day < 7) {
  //     dd = new Date(year, 5, 7)
  //   } else {
  //     dd = new Date(year + 1, 5, 7)
  //   }
  // }
  // 目标日期
  // var dd = new Date(2023, 5, 7);
  // 日期对象-日期对象=得到时间戳差
  var diff = dd - d;
  // 将时间戳差变为时间对象 此时的时间对象是相对于1970年1月1日的
  // 计算和1970年1月1日8时0分相差了多久
  var time = new Date(diff);
  var p = new Date(0);
  var year = time.getFullYear() - 1970;
  var month = time.getMonth() - 1 + 1; //getMonth()返回的月份是从0开始计算，所以加了个1
  var date = time.getDate() - 1;
  var hours = time.getHours() - 8; //减去8个小时的时区
  var minutes = time.getMinutes();
  var seconds = time.getSeconds();
  // 剩下的总天数
  var days_left = parseInt(diff / (1000 * 24 * 60 * 60) + 1);
  return days_left
  // }, 1000);
}

Page({

  /**
   * 页面的初始数据
   */
  data: {
    showInfo:false,
    list: [{
      "redirectUrl": "/pages/school/index/index",
      "title": "找大学",
      "type": 2,
      "picUrl": "https://ehsimg.oss-cn-beijing.aliyuncs.com/temp/792651d364a445ddab0ac6519e4b4d7d.png",
      "istab": 0,
      "status": 1
    }, {
      "redirectUrl": "/pages/major/index/index",
      "title": "查专业",
      "type": 2,
      "picUrl": "https://ehsimg.oss-cn-beijing.aliyuncs.com/temp/788301381ecc4e92af20dc56c56a304e.png",
      "createBy": "admin",
      "createTime": "2022-12-15 13:59:57",
      "updateBy": "admin",
      "istab": 0,
      "id": 8,
      "status": 1
    }, {
      "redirectUrl": "/pages/score/batch/index",
      "title": "批次线",
      "type": 2,
      "picUrl": "https://ehsimg.oss-cn-beijing.aliyuncs.com/temp/0d13fb0b21c248c0a6a3381d069930d8.png",
      "createBy": "admin",
      "createTime": "2022-12-15 14:01:27",
      "updateBy": "admin",
      "istab": 0,
      "id": 11,
      "status": 1
    }, {
      "redirectUrl": "/pages/score/rank/index",
      "title": "一分一段",
      "type": 2,
      "picUrl": "https://ehsimg.oss-cn-beijing.aliyuncs.com/temp/e18e9826ce26404f898bacc5fc9f23c0.png",
      "createBy": "admin",
      "createTime": "2022-12-15 14:00:45",
      "updateBy": "admin",
      "istab": 0,
      "id": 10,
      "status": 1
    }, {
      "redirectUrl": "/pages/school/rank/index",
      "title": "院校排行",
      "type": 2,
      "picUrl": "https://ehsimg.oss-cn-beijing.aliyuncs.com/temp/b8a50bb84af84ce2886d135259ac0f8f.png",
      "createBy": "admin",
      "createTime": "2022-12-15 14:25:54",
      "updateBy": "admin",
      "istab": 0,
      "id": 19,
      "status": 1
    }, {
      "redirectUrl": "/pages/topic/index/index",

      "title": "高考真题",
      "type": 2,
      "picUrl": "https://ehsimg.oss-cn-beijing.aliyuncs.com/temp/033e6bc7b3ad4d98af101170045b9cf8.png",
      "createBy": "admin",
      "createTime": "2022-12-15 14:08:08",
      "updateBy": "admin",
      "istab": 0,
      "id": 18,
      "status": 1
    }, {
      "redirectUrl": "/pages/volunteer/index/index",

      "title": "智能填报",
      "type": 2,
      "picUrl": "https://ehsimg.oss-cn-beijing.aliyuncs.com/temp/35b2291242c54ab5840c3529e003a995.png",
      "createBy": "admin",
      "createTime": "2022-12-15 14:01:45",
      "updateBy": "admin",
      "istab": 0,
      "id": 12,
      "status": 1
    }, {
      "redirectUrl": "/pages/plan/index",

      "title": "招生计划",
      "type": 2,
      "picUrl": "https://ehsimg.oss-cn-beijing.aliyuncs.com/temp/86417a7f0ca046b5b57b9fe9e4c8d458.png",
      "createBy": "admin",
      "createTime": "2022-12-15 14:03:35",
      "updateBy": "admin",
      "istab": 0,
      "id": 16,
      "status": 1
    }, {
      "redirectUrl": "/pages/school/compare/index",

      "title": "院校对比",
      "type": 2,
      "picUrl": "https://ehsimg.oss-cn-beijing.aliyuncs.com/temp/97da8ff6898c4d79950bf7807f3cdabf.png",
      "createBy": "admin",
      "createTime": "2022-12-15 14:02:29",
      "updateBy": "admin",
      "istab": 0,
      "id": 14,
      "status": 1
    }, {
      "redirectUrl": "/pages/optional/index/index",

      "title": "高考选科",
      "type": 2,
      "picUrl": "https://ehsimg.oss-cn-beijing.aliyuncs.com/temp/7b00906ca60648be9f0430c18cb6f013.png",
      "createBy": "admin",
      "createTime": "2022-12-15 14:02:54",
      "updateBy": "admin",
      "istab": 0,
      "id": 15,
      "status": 1
    }, {
      "redirectUrl": "/pages/program/index",

      "title": "高考日程",
      "type": 2,
      "picUrl": "https://ehsimg.oss-cn-beijing.aliyuncs.com/temp/be6d07ccecdc4ba1a67ed427c87ec62f.png",
      "createBy": "admin",
      "createTime": "2022-12-15 14:02:16",
      "updateBy": "admin",
      "istab": 0,
      "id": 13,
      "status": 1
    }, {
      "redirectUrl": "/pages/test/index/index",
      "title": "职业测评",
      "type": 2,
      "picUrl": "https://ehsimg.oss-cn-beijing.aliyuncs.com/temp/20d88835df8e4c3baa7a55c68251f814.png",
      "createBy": "admin",
      "createTime": "2023-01-28 10:10:19",
      "updateBy": null,
      "istab": 1,
      "id": 20,
      "status": 1
    }],
    select: 1,
    nationalList: [{
        title: '高考分数',
        detail: '6月24日'
      },
      {
        title: '志愿填报',
        detail: ''
      }, {
        title: '录取查询',
        detail: ''
      }
    ],
    schoolShow: false,
    dialogVisible: false,
    swiperCurrent: 0,
    show: false,
    banner: [],
    navHeight: getApp().globalData.navHeight,
    navTop: getApp().globalData.navTop,
    menuHeight: getApp().globalData.menuHeight,
    status: 20,
    windowHeight: getApp().globalData.windowHeight,
    total: 0,
    showSelect: false,
    selectData: {},
    scrollTop: 0,
    isBack: false,
    currentRegion: {},
    userCities: [],
    cityCode: null,
    chooseMainSubject: '',
    floorstatus: false,
    showFilterModal: false,
    showModal: false,
    articleList: [],
    courseList: [],
    serviceList: [],
    arrayIndex: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
    tabbarHeight: getApp().globalData.tabbarHeight,
    token: '',
    vipShow: false,
    currentIndex: 1,
    payType: 0
  },

  /**
   * 生命周期函数--监听页面加载
   */
  async onLoad(e) {
    wx.hideTabBar()
    getApp().editTabbar()

    // this.getSchoolRecommend()
    var total = gaokaoTime()
    var totalArray = total.toString().split('')
    this.setData({
      total,
      totalArray
    })
    this.getSubjectList()
    this.getBannerList()
    this.getNavList()
    this.getArticleList()
    this.getCourseList()
    this.getServiceList()
    if (e !== undefined) {
      if (e.spreadUserId) {
        wx.setStorageSync('spreadUserId', e.spreadUserId)
      }
      if (typeof (e.scene) != 'undefined') {
        checkLogin().then((res) => {
          console.log(e)
          if (e.scene.indexOf('INVITE') > -1) {
            const id = e.scene.split('_')[1]
            wx.navigateTo({
              url: '/pages/users/invite/index?id=' + id,
            })
          }
          if (e.scene.indexOf('PRICE') > -1) {
            const id = e.scene.split('_')[1]
            wx.navigateTo({
              url: '/pages/article/activity/index?id=' + id,
            })
          }
          if (e.scene.indexOf('REVIEW') > -1) {
            // checkLogin().then((res) => {
            const reviewId = e.scene.split('_')[1]
            const studentId = e.scene.split('_')[2]
            if (e.scene.indexOf('REVIEW_IMPORT_') > -1) {
              let id = e.scene.split('REVIEW_IMPORT_')[1]
              wx.navigateTo({
                url: '/pages/auth/index?type=test&studentId=' + id,
              })
            } else {
              wx.navigateTo({
                url: '/pages/test/question/index?id=' + reviewId + '&studentId=' + studentId,
              })
            }
            // reviewScan(reviewId)
            // })
          }
          if (e.scene.indexOf('DISCOUNT') > -1) {
            const cardBatchId = e.scene.split('_')[1]
            this.setData({
              cardBatchId
            })
            this.doWxPay()
          }
          if (e.scene.indexOf('student') > -1) {
            const scene = e.scene.split('_')[1]
            wx.navigateTo({
              url: '/pages/auth/index?type=login&scene=' + scene,
            })
          }
          if (e.scene.indexOf('planner') > -1) {
            const scene = e.scene.split('_')[1]
            wx.navigateTo({
              url: '/pages/auth/index?type=planner&scene=' + scene,
            })
          }
          if (e.scene.indexOf('CR') > -1) {
            const qrcode = e.scene.split('_')
            var cardNumber = qrcode[0]
            var cardPassword = qrcode[1]
            if (qrcode.length > 2) {
              wx.setStorageSync('qrcode', JSON.stringify(qrcode))
              wx.switchTab({
                url: '/pages/test/index/index',
              })
              return
            }
            wx.navigateTo({
              url: '/pages/users/activation/index?cardNumber=' + cardNumber + '&cardPassword=' + cardPassword,
            })
          } else {
            wx.setStorageSync('promoteUser', e.scene)
          }
        })

      }
    }
    // this.fetchUserInfo()
 
  },
  getPrivacyService() {
    if (wx.onNeedPrivacyAuthorization) {
      wx.onNeedPrivacyAuthorization(resolve => {
        this.selectComponent('#agreement').show();
        this.resolvePrivacyAuthorization = resolve
      })
      wx.requirePrivacyAuthorize({
        success: res => {},
        fail: () => {},
        complete: () => {}
      })
    }
  },
  getToday() {
    let that = this
    wx.getStorage({
      key: 'today',
      success: function (res) {
        if (res.data && res.data != new Date().toLocaleDateString()) {
          that.fetchUserInfo()
          wx.setStorageSync("today", new Date().toLocaleDateString());
        }
      },
      fail: function (res) {
        wx.setStorageSync("today", new Date().toLocaleDateString());
        that.fetchUserInfo()
      }
    })
  },
  // 获取首页推荐学校
  async getSchoolRecommend() {
    const {
      result
    } = await schoolRecommend()
    this.setData({
      schoolRecommend: result.school,
      planList: result.planList,
      schoolShow: true,
    })
  },
  // 触摸开始事件
  touchStart: function (e) {
    this.setData({
      touchDot: e.touches[0].pageX
    })

  },
  // 触摸移动事件
  touchMove: function (e) {
    const {
      touchDot
    } = this.data
    var touchMove = e.touches[0].pageX;
    // 向左滑动
    if (touchMove - touchDot <= -40) {
      direction = 0
    }
    // 向右滑动
    if (touchMove - touchDot >= 40) {
      direction = 1

    }
  },
  // 触摸结束事件
  touchEnd: function (e) {
    let {
      swiperCurrent,
      banner
    } = this.data
    const {
      index
    } = e.currentTarget.dataset
    if (direction) {
      swiperCurrent == 0 ? swiperCurrent = banner.length - 1 : swiperCurrent = index - 1
    } else {
      swiperCurrent == banner.length - 1 ? swiperCurrent = 0 : swiperCurrent = index + 1
    }
    this.setData({
      swiperCurrent
    })

  },
  dialogClose(e) {
    const {
      type
    } = e.currentTarget.dataset
    if (type == 'dialogVisible') {
      this.getSchoolRecommend()
    }
    if (type == 'vipShow') {
      this.setData({
        dialogVisible: true
      })
    }
    this.setData({
      [type]: false
    })
  },
  changeIndex(e) {
    const {
      index
    } = e.currentTarget.dataset
    this.setData({
      currentIndex: index,
      payType: index == 0 ? 1 : 0
    })
    this.setData({
      courseList: []
    })
    this.getCourseList()
  },
  async fetchUserInfo() {
    const res = await getApp().fetchUserInfo()
    const vips = res.vips || []
    const vipsExpired = res.vipsExpired || []
    let vipShow = vipsExpired.length > 0 && vips.length <= 0 ? true : false
    let dialogVisible = false
    if (!vipShow) {
      // dialogVisible = true
      this.getSchoolRecommend()
    }
    this.setData({
      vipShow,
      dialogVisible
    })
  },
  async doWxPay() {
    const {
      cardBatchId
    } = this.data
    if (!cardBatchId) return
    const params = {
      cardBatchId
    }
    var _this = this
    const {
      result
    } = await discountPay(params)
    wx.requestPayment({
      nonceStr: result.nonceStr,
      package: result.package,
      paySign: result.paySign,
      timeStamp: result.timeStamp,
      signType: result.signType,
      success: async function (res) {
        wx.showToast({
          icon: 'success',
          title: '会员开通成功',
        })
        getApp().fetchUserInfo()
        _this.setData({
          cardBatchId: ''
        })
        _this.sendMessage()
      },
      fail: function (res) {}
    })
  },
  sendMessage() {
    var temIds = ['VTJr-PYcl78g4cmSM3WdT95GBxWTRpPmG1ArKkRQGcY']
    message(false, temIds)
  },
  async getSubjectList() {
    const subjectList = wx.getStorageSync('subjectList') || await getApp().getSubjectList()
    this.setData({
      subjectList
    })
  },
  async getArticleList() {
    const params = {
      pageNo: 1,
      pageSize: 4,
      type: 1
    }
    const {
      result
    } = await articleList(params)
    this.setData({
      ['articleList[0]']: result.records,
    })
  },
  async getCourseList() {
    const params = {
      pageNo: 1,
      pageSize: 100,
      payType: this.data.payType
    }
    const {
      result
    } = await courseList(params)
    this.setData({
      ['courseList[0]']: result.records,
    })
  },
  async getServiceList() {
    const params = {
      pageNo: 1,
      pageSize: 5,
      type: 3
    }
    const {
      result
    } = await articleList(params)
    this.setData({
      ['serviceList[0]']: result.records,
    })
  },
  onHide() {
    clearInterval(timer)
  },
  calculatorUser() {
    var total = gaokaoTime()
    var _this = this
    timer = setInterval(function () {
      if (total < 1) {
        clearInterval(timer)
      } else {
        total = gaokaoTime()
        const totalStr = total.toString()
        const array = totalStr.split('')
        const totalArray = array.map((item) => {
          return parseInt(item)
        })
        _this.setData({
          total,
          totalArray
        })
      }
    }, 5000)
  },
  onShow() {
    this.getPrivacyService()
    this.calculatorUser()
    const {
      token,
    } = this.data
    checkLogin().then(async (res) => {
      this.setData({
        showInfo:true
      })
      if (token === wx.getStorageSync('token')) {
        return
      }
      this.setData({
        token: wx.getStorageSync('token')
      })
      getApp().getMessageNum().then(allCount => {
        this.setData({
          allCount
        })
      })
      this.getScore()
      this.getToday()
    }).catch((e) => {
      this.setData({
        showInfo:false,
        token: wx.getStorageSync('token'),
      })
      // wx.showModal({
      //   title: '是否跳转至登录页',
      //   content: '需要您登录后，才能获取其中的内容',
      //   success: function (res) {
      //     if (res.confirm) {
      //       wx.navigateTo({
      //         url: '/pages/login/index',
      //       })
      //     }
      //   }
      // })
    })
    if (!wx.getStorageSync('userCitys')) {
      this.getLocation()
    } else {
      this.setData({
        currentRegion: wx.getStorageSync('userCitys'),
      })
    }
  },
  swiperChange(e) {
    if (e.detail.source == "touch" || e.detail.source == "autoplay") {
      this.setData({
        swiperCurrent: e.detail.current
      })
    }
  },
  async getScore() {
    let spreadUserId = wx.getStorageSync('spreadUserId')
    // if(wx.getStorageSync('today')){
    //   this.getSchoolRecommend()
    // }
    var {
      result
    } = await getScore(spreadUserId)

    if (result && result.provinceId && result.secondSelect) { //新用户无成绩时
      this.setData({
        ...result
      })
      const subjectList = wx.getStorageSync('subjectList') || await getApp().getSubjectList()
      const cityList = wx.getStorageSync('cityList') || await getApp().getCityList()
      const currentCityList = cityList.filter((item) => {
        return item.id == result.provinceId
      })
      let newTime = Math.round(new Date())
      const userCitys = {
        code: currentCityList[0].id,
        name: currentCityList[0].title,
        time: newTime
      }
      let checkedIds = []
      const secondSelect = result.secondSelect == '' ? [] : result.secondSelect.split(',')
      var firstSelectSubjects = ''
      var secondSelectSubjects = []
      subjectList.map((item) => {
        if (result.firstSelect !== '' && item.id == result.firstSelect) {
          firstSelectSubjects = item.name
          checkedIds.push(parseInt(result.firstSelect))
        }
        if (secondSelect.indexOf(item.id) > -1 || secondSelect.indexOf(item.id.toString()) > -1) {
          secondSelectSubjects.push(item.name)
          checkedIds.push(parseInt(item.id))
        }
      })
      result.firstSelectSubjects = firstSelectSubjects
      result.secondSelectSubjects = secondSelectSubjects.join(',')
      if (checkedIds.length > 0) {
        wx.setStorageSync('ids', checkedIds)
      }
      wx.setStorageSync('mainSubject', result.firstSelect == '' ? '' : parseInt(result.firstSelect))
      wx.setStorageSync('score', result.score)
      wx.setStorageSync('ranking', result.ranking)
      wx.setStorageSync('year', result.year)
      wx.setStorageSync('userCitys', userCitys)
      wx.setStorageSync('subjectInfo', result)
      this.setData({
        currentRegion: userCitys
      })
      if (!wx.getStorageSync('yearDisabled')) {
        this.setData({
          showModal: true
        })
      }
      getApp().getVoluntaryConfigCity()
    } else {
      if (!wx.getStorageSync('yearDisabled')) {
        this.setData({
          showModal: true
        })
      }
      getApp().getVoluntaryConfigCity()
    }

  },


  onPageScroll: function (e) {
    //控制回到顶部按钮显示+隐藏
    if (e.scrollTop > 10) {
      this.setData({
        floorstatus: true
      });
    } else {
      this.setData({
        floorstatus: false
      });
    }
  },
  scroll(e) {
    const {
      left
    } = this.data
    const {
      scrollLeft
    } = e.detail
    const ratio = 0.13
    const currentLeft = 0.13 * scrollLeft
    var leftP = currentLeft
    if (currentLeft > 20) {
      leftP = 24
    }
    if (currentLeft < 5) {
      leftP = 0
    }
    this.setData({
      left: leftP
    })
  },

  getLocation() {
    let self = this;
    // 实例化API核心类
    qqmapsdk = new QQMapWX({
      key: 'ZKIBZ-5F43X-ZD74H-ZMS3D-HQXW7-QQBDF'
    });
    wx.showLoading({
      title: '加载中'
    });
    this.testLocation()
  },

  async getBannerList() {
    const param = {
      status: 1
    }
    const {
      result
    } = await mainViewPic(param)
    this.setData({
      banner: result
    })
  },
  async getNavList() {
    const param = {
      status: 1,
      type: 2
    }
    const {
      result
    } = await mainViewPic(param)
    this.setData({
      list: result,
    })
  },
  chooseCity() {
    var currentRegion = this.data.currentRegion
    if (currentRegion.lock || typeof (currentRegion.lock) === 'undefined') {
      wx.showModal({
        confirmText: '继续修改',
        title: '请慎重选择',
        content: '考生所在省份,一经确定无法进行更改',
        success: (res) => {
          if (res.confirm) {
            wx.navigateTo({
              url: '/pages/list/index?type=index&category=city',
            })
          }
        },
      })
    } else {
      wx.showToast({
        title: '不可修改',
        icon: 'none'
      })
    }

  },

  search() {
    // checkLogin().then(() => {
      wx.navigateTo({
        url: '/pages/search/index',
      })
    // })
  },
  onLoadFunc() {
    this.doWxPay()
    // this.fetchUserInfo()
    // this.getScore()
  },
  contact() {
    getApp().getCustomerService()
  },
  goto(e) {
    let {
      url,
      type,
      auth,
      obj,
      show
    } = e.currentTarget.dataset
    if (auth) {
      var isStringToJson = canParseToJson(obj)
      // checkLogin().then((res) => {
        if (obj) {
          console.log(isStringToJson)
          if (isStringToJson) {
            console.log('aaa')
            obj = JSON.parse(obj)
            if (obj.isTab) {
              wx.switchTab({
                url: obj.url,
              })
            } else {
              console.log('bbb')
              wx.navigateTo({
                url: obj.url + '?params=' + encodeURIComponent(JSON.stringify(obj)),
              })
            }
          } else {
            console.log('ccc')
            wx.navigateTo({
              url: obj,
            })
          }
          return
        }
        if (type == 1) {
          wx.switchTab({
            url,
          })
        } else {
          var arr = ['/pages/school/index/index', '/pages/major/index/index', '/pages/score/rank/index', '/pages/volunteer/index/index']
          // var arr = ['/pages/score/rank/index', '/pages/volunteer/index/index']
          if (arr.indexOf(url) > -1) {
            // if (!wx.getStorageSync('subjectInfo')) {
            //   this.setData({
            //     showModal: true
            //   })
            //   return
            // }
            wx.navigateTo({
              url,
            })
            return
          }
          wx.navigateTo({
            url,
          })
        }

      // }).catch((e) => {
      //   wx.showToast({
      //     title: '请先登录！',
      //     icon: 'none'
      //   })
      //   setTimeout(() => {
      //     wx.navigateTo({
      //       url: '/pages/login/index',
      //     })
      //   }, 500);
      // })
      return
    }
    if (show == 'dialogVisible') {
      this.getSchoolRecommend()
    }
    if (show == 'vipShow') {
      this.setData({
        dialogVisible: true
      })
    }
    this.setData({
      [show]: false
    })
    wx.navigateTo({
      url,
    })
  },
  article(e) {
    // checkLogin().then((res) => {
      const {
        title,
        type,
        list,
        mode,
        pay
      } = e.currentTarget.dataset
      const array = list !== undefined ? encodeURIComponent(JSON.stringify(list)) : []
      wx.navigateTo({
        url: '/pages/article/list/index?payType=' + pay + '&mode=' + mode + '&title=' + title + '&type=' + type + (array.length > 0 ? '&list=' + array : '')
      })
    // }).catch(() => {
    //   wx.showToast({
    //     title: '请先登录！',
    //     icon: 'none'
    //   })
    //   setTimeout(() => {
    //     wx.navigateTo({
    //       url: '/pages/login/index',
    //     })
    //   }, 500);
    // })

  },
  login() {
    wx.showToast({
      title: '请先登录！',
      icon: 'none'
    })
    setTimeout(() => {
      wx.navigateTo({
        url: '/pages/login/index',
      })
    }, 500);
  },
  testLocation() {
    var item = {
      "code": 350000,
      "name": "福建",
    }
    wx.setStorageSync('userCitys', item)
    wx.hideLoading({});
    this.setData({
      currentRegion: item
    })
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
    return {
      title: '德道升学',
      imageUrl: 'https://ehsimg.oss-cn-beijing.aliyuncs.com/images/static/users/shareImg.jpg',
      path: '/pages/index/index?scene=' + wx.getStorageSync('userInfo').id,
    }
  }
})
